Computer graphic system and method for simulating hair

ABSTRACT

A computer graphic system and methods for simulating hair is provided. In accordance with aspects of the disclosure a method for hybrid hair simulation using a computer graphics system is provided. The method includes generating a plurality of modeled hair strands using a processor of the computer graphics system. Each hair strand includes a plurality of particles and a plurality of spring members coupled in between the plurality of particles. The method also includes determining a first position and a first velocity for each particle in the plurality of modeled hair strands using the processor and coarsely modeling movement of the plurality of modeled hair strands with a continuum fluid solver. Self-collisions of the plurality of modeled hair strands are computed with a discrete collision model using the processor.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims the benefit under 35 U.S.C. §119(e) toU.S. Provisional Patent Application No. 61/175,327, which was filed onMay 4, 2009, and entitled “Detail Preserving Continuum Hair Simulation,”which is incorporated by reference into the present application in itsentirety.

TECHNICAL FIELD

Aspects of the present disclosure relate generally to computer animationand, more specifically, to hair simulation in computer generatedanimation.

BACKGROUND

The simulation of hair is widely implemented in computer graphics, ashair is an integral part of creating many virtual characters. Manyapproximations for simulating hair exist, but they typically fail toprovide the amount of detail that real hair exhibits. Severalapplications, such as feature films, aim to capture the high degree ofcomplexity caused by several thousand interacting hair strands.Unfortunately, the massive number of hairs interacting and collidingmakes hair simulation on a virtual character one of the most challengingaspects of computer graphics. Even though individual hair dynamics scalewell to multiple hairs (as each hair is dynamically uncoupled),accurately simulating many hairs interacting with each other remains achallenge.

Numerous approaches have been developed to manage the complexity of manyhairs interacting. Generally, these approaches simulate a smaller set ofguide hairs (typically no more than several hundred) that interact withlarge repulsion forces, interpolating a larger number of hairs forrendering. This leads to very efficient simulation times, but a limitedamount of hair detail is captured (especially stray hairs such as theso-called “flyaways”) because, essentially, each guide hair representshundreds (or even thousands) of actual hairs.

Alternatively, there have been several methods that treat everysimulated hair as part of a fluid-like continuum volume. Theseapproaches naturally model hair interaction without explicit collisions.However, intricate features of individual hairs are lost because eachhair is part of the continuum.

The foregoing is believed to be helpful in providing the reader withbackground information to facilitate a better understanding of thevarious aspects of the present disclosure. Accordingly, it should beunderstood that these statements are to be read in this light, and notas admission of prior art.

SUMMARY

One aspect of the disclosure may involve a method for hybrid hairsimulation using a computer graphics system. The method includesgenerating a plurality of modeled hair strands using a processor of thecomputer graphics system. Each hair strand includes a plurality ofparticles and a plurality of spring members coupled in between theplurality of particles. The method also includes determining a firstposition and a first velocity for each particle in the plurality ofmodeled hair strands using the processor and coarsely modeling movementof the plurality of modeled hair strands with a continuum fluid solver.Self-collisions of the plurality of modeled hair strands are computedwith a discrete collision model using the processor.

Another aspect of the disclosure may involve a Eulerian and Lagrangianhybrid method of artificial hair simulation using a computer graphicssystem. The method includes determining an initial position and avelocity for each of a plurality of hair strands and computing abackward Euler solve for each of the plurality of hair strands. Thevelocity of each of the plurality of hair strands is rasterized to athree-dimensional grid and, using a volume technique, modifying thevelocity into a corrected divergence free velocity. The modifiedvelocity is interpolated out of the three-dimensional grid and furthermodified to satisfy body and self-collisions. A final position of eachof the plurality of hair strands is computed.

Yet another aspect of the disclosure may involve a computer graphicssystem for simulating hair using a Eulerian/Lagrangian hybrid method.The computer graphics system includes at least one processor and atleast one computer readable medium communicatively coupled to the atleast one processor. The at least one computer readable medium includescode executable by the at least one processor to determine a firstcollision-free location and a first velocity for each particle of one ormore computer generated stands of hair. Additionally, the code isexecutable by the processor to rasterize the first velocity to a grid,compute a second velocity of the computer graphic strands of hair forthe second velocity being divergent free and apply a fluid implicitparticle (FLIP) solver to the second velocity to interpolate the secondvelocity to the particles. The computer graphics system computes bodyand self-collisions of the one or more strands of hair and determines afinal position of the one or more computer graphic strands of hair.

These and other advantages, aspects and features of the presentdisclosure will become apparent to those of ordinary skill in the artupon reading this disclosure in its entirety.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates hair simulated as curves.

FIG. 2 illustrates hair simulated as velocities.

FIG. 3 is a flowchart illustrating a hybrid method of simulating haircombining a coarse Eulerian method and a fine Lagrangian technique.

FIG. 4 is a flowchart illustrating the coarse Eulerian method of theflowchart of FIG. 3.

FIG. 5 illustrates density control of simulated hair.

FIGS. 6A-6B illustrate results of a lack of separation control in avolume method when groups of hair have divergent velocities.

FIGS. 7A-7B illustrate results of separation control in a volume methodwhen groups of hair have divergent velocities.

FIG. 8 is a flowchart illustrating the fine Lagrangian technique of thesimplified flowchart of FIG. 3.

FIG. 9 illustrates an example computer graphics system for hairsimulation.

FIG. 10 illustrates an example implementation of the hybrid method ofsimulation hair using three braided groups of hair.

FIGS. 11A-D illustrates another example implementation of the hybridmethod of hair simulation on an animated character.

FIGS. 12A-12B provide a comparison of hair simulated using the hybridtechnique and real hair.

FIGS. 13A-13C provides a graphical comparison of the present hybridtechnique for hair simulation with purely Lagrangian and purely Euleriantechniques for hair simulation.

DETAILED DESCRIPTION

Aspects of the present disclosure involve systems and methods forgraphically simulating hair. More specifically, the present disclosureprovides systems and methods for simulating the movement of hair, suchas the movement of hair on an animated character. Generally, thesimulation considers the hair movement in discrete time-steps and, ineach time-step, the hair is modeled as fluid before hair-to-haircollisions are considered. Modeling the hair as a fluid efficientlymanages most of the various interactions that occur as the hair moves,thus alleviating some burden of the hair-to-hair collision computation.

Accordingly, the hair simulation may generally be considered as twoparts. The first part is a coarse, highly-coupled volumetric behaviorsimulation, which is efficiently modeled by a continuum. The second partis a finer, more locally-coupled Lagrangian particle simulation of hair.Unlike previous continuum-based approaches that only simulate guidehairs that do not interact directly, the present technique simulatesmany hairs (e.g., thousands) that are allowed to collide directly aswell as through the volume. Self-collisions are more efficiently handledwith the two-part simulation than with fully Lagrangian collision modelsbecause the volume continuum modeling does most of the work towardsresolving collisions. Thus, the present approach combines a Lagrangianhair solver with a fluid simulator and can capture the intricate detailsof many individual strands while efficiently maintaining the overallhair volume.

FIG. 1 illustrates the hair modeled as curves 100. In the techniquesdiscussed herein, the hair is modeled as curves as a starting point andan end point for each time-step. Generally, the curves 100 may beimplemented using any one of a variety of different constitutive methodsfor modeling individual hair strands or clumps of hair. For example,generalized (reduced) coordinate models or rigid body models may beused. In the generalized coordinate model, particles degrees of freedomare defined implicitly by linking to one or more other particles. In oneembodiment, a mass/spring system and projective dynamics may be used.Mass/spring simulated lattice deformers can be added to model torsion.In the rigid body models, position and orientation are known and mayinclude using rigid body chaining methods or techniques based on elasticrod theory. More accurate models such as the elastic rod theory, usecontinuum mechanics to define forces on particles. Yet anotherembodiment includes modeling of a twist as deviation from a canonicalframe as well as a method to evolve this separately quasistatically.

In the interest of simplicity, a mass/spring model will be used for thehair curves described herein. In the mass/spring model, each particle(i.e., mass) in sequence is connected with a spring and every otherparticle with a bending spring. It should be understood, however, thattorsion could be added to the mass/spring model or a different strandmodel may be implemented (such as a articulated rigid body or Cosseratmodel).

FIG. 2 illustrates the modeling of hair as a volume of velocitiesrepresented by arrows 200 in accordance with the volumetric behaviorsimulation. In FIG. 2, the arrows 200 indicate grid velocities afterbeing rasterized and made divergence free. The magnitude of the gridvelocity is represented by the length 202 of each arrow 200.Additionally, a base 204 of each arrow 200 represents the position ofgrid cell centers in and the arrow 200 points the direction the gridcell center is moving.

There are various different possible approaches to modeling hair as avolume. Generally, a Eulerian volume model may be implemented. Moreparticularly, in one embodiment, a fluid implicit particle FLIP basedfluid solver may be implemented. The volume modeling is performed priorto the Lagrangian self-collisions, providing efficiency gains as mostcollisions are handled in the volume model rather than thecomputationally intensive Lagrangian self-collisions.

FIG. 3 is a flowchart illustrating a method for modeling hair (Block300) in accordance with an example embodiment. More specifically, theflowchart illustrates a single time-step that is repeated iteratively tomodel hair throughout a full course of movement. The duration of thetime-step may generally be a fraction of a second, but may vary indifferent actual implementations depending on a velocity of the hairduring the movement. Typically, as the velocity of the hair increases,the duration of the time step is reduced to provide sufficientcontinuity of movement and maintain tractability. The movement of thehair is defined by the forces in the system, such as gravity and thespring forces, and the positions and velocities of the particles evolveas the hair moves and collisions occur.

For each time-step, a collision-free position and velocity is initiallysaved for each particle (Block 302). That is, a position and velocity isdetermined and stored in memory and the collision-free position andvelocity serve as a start-point for the hair movement. In Block 302, theposition of particles 301 of two curves 303 are illustrated andrepresent simulated hair strands. The curves 303 may represent multiplestrands Backward Euler velocities are computed from the initial positionand velocity (Block 304). In Block 304, the velocities of the particlesare illustrated as arrows 305 extending from each particle 301. Inparticular, for each particle 301, the velocity for the time-step iscomputed using the equation v*_(i) ^(n+1)=v_(i) ^(n)+Δta_(i)(x_(i)^(n),v*_(i) ^(n+1)), where v_(i) is the velocity and x_(i) is theposition for the i^(th) particle and t_(n) is the time step. Theacceleration term (a_(i)(x_(i) ^(n),v*_(i) ^(n+1))) is separated into alinear damping part and a non-linear elastic part to preserve elasticmodes. Elastic modes refer to parts of deformation that come fromrelieving elastic energy. For example, if a guitar string is plucked,the elastic modes cause it to vibrate. When the string is dampened, witha hand, for example, that is a damping (or diffusive) force. Elasticmodes give hair some of its interesting properties. If they are notpreserved, then the damping modes dominate making simulations appear tooslow, as if underwater.

Once the velocities are determined, a volume technique is employed tomodify the computed velocity v*_(i) ^(n+1) into a corrected velocityv_(i) ^(n+1). In one embodiment, this is accomplished using a Euleriantechnique by first rasterizing the velocities to a grid (Block 306).Block 306 shows the grid 307 with representative velocities 309 in eachgrid cell 311. The grid 307 represents the hair density and each gridcell 311 is three dimensional to account for the multi-dimensionalmovement of the hair strands. Specifically, hair density is representedby the silhouette 299. Although the silhouette 299 gives the appearanceof uniform density, depending on a weighting kernel that is used, thedensity may have a gradient.

The velocities (e.g., arrows 305) are modified to account for bulkself-interaction by making the velocities divergence free (Block 308).That is, for each arrow 305, it is determined if there is any overlapwith another arrow 305. Overlap of arrows 305 indicates a collision anda modified velocity 313 is computed to account for the collision. Withinthe grid structure, particle position and, therefore, arrow 305 positionis known relative to the grid cells 311. Collisions are implicitly knownto occur wherever the rasterized grid 307 has non-zero divergence.

Once the velocities have been modified to account for collisions, themodified velocity 313 information is applied back into particlevelocities (Block 310). That is, the information is interpolated out ofthe grid cells 311 and back into the particle representation. The stepsrepresented in Block 306-310 serve as pre-conditioning steps forperforming the locally-coupled Lagrangian simulation. Because bulkcollisions are handled by the grid 307, the Lagrangian simulation isless computationally intensive.

Once returned to particle velocities, self-collisions are accounted for(Block 312) and the Euler step positions are determined (Block 314). Inone embodiment, the self-collisions may be accounted for using Bridsontechniques and, as such, Bridson, R., R. Fedkiw and J. Anderson, “RobustTreatment of Collisions, Contact and Friction for Cloth Animation,” (ACMTRANS. GRAPH. 21.3 (2002): 594-603), is hereby incorporated by referencein its entirety and for all purposes. Other embodiments may implementother techniques. The final positions may subsequently be used as aninitial position for a subsequent iteration of the time step process.

The following discussion explains in greater detail the steps of Blocks306-312, as well as other features associated with the method 300 ofFIG. 3. Specifically, the volume method for handling bulk collisions,separation techniques for divergent velocity fields, the locally-coupledLagrangian techniques, and a graphics system for implementing the hybridtechnique and test results are discussed in greater detail.

Volume Method

A volume method, such as the method shown in FIG. 3 at Block 306-310, isone way to process self-interaction of many hairs. When many real hairsare near each other or closely coupled, their contact and collisionsallow a propagation of any force through other hairs in contact. Thisbehavior is similar to the behavior of a fluid, which conserves momentumand mass. Hence, in some embodiments, for computational efficiency, hairmay be modeled as an incompressible fluid.

Two conventional approaches to model fluid volumes are Lagrangiantechniques (e.g., smoothed particle hydrodynamics (SPH), or vortexparticle methods) and Eulerian techniques (e.g., commonpressure/velocity incompressible solvers). Selection of one techniqueover another generally involves a trade off. Standard SPH effectivelyhandles compressible flow, but Eulerian techniques tend to be moreefficient than Lagrangian techniques for modeling fluid volumes becausenearest neighbor searches are unnecessary. Contrarily, the Eulerianapproaches implements uniform grids that limit the amount of detailavailable. Vortex particle based methods limit detail because highdegree unstructured stencils create numerical smoothing. In the presenthybrid technique, lack of detail resulting from use of any oneparticular conventional volume method as a first part of the process isovercome by implementing Lagrangian techniques in the second part of theprocess to capture high fidelity detail after the volume method.Furthermore, the high-fidelity interactions are tractable in the presenttechnique.

In one embodiment, a traditional Eulerian advection equation of velocityv_(t)+v∇·v=0 is implemented for fluid advection. Fluid advection refersgenerally to transport with a general flow of a fluid. In anotherembodiment, a FLIP method is implemented which replaces the traditionalEulerian advection equation of velocity with a Lagrangian Euler stepx_(i) ^(n+1)=x_(i) ^(n)+Δtv_(i) ^(n). This velocity is rasterized to agrid and made divergence free using the Chorin projection method.Generally, the Chorin projection method is a two-stage process thatincludes computing an intermediate velocity and projecting theintermediate velocity with a pressure to a divergence-free velocityfield. The divergence free velocity field is compared to the originalgrid velocity field, and this difference is interpolated to theparticles and applied as an impulse. Zhu, Y., and R. Bridson, “AnimatingSand as a Fluid,” (ACM TRANS. GRAPH. 27, 3 (2005): 965-972), details theuse of the FLIP method and is hereby incorporated by reference in itsentirety and for all purposes.

The FLIP method provides a convenient way to transition from the grid toparticles. Losasso, F, J. Talton, N. Kwatra and R. Fedkiw, “Two-waycoupled SPH and Particle Level Set Fluid Simulation,” (2008)demonstrates a hybrid grid/particle SPH technique that uses FLIP as acoupling mechanism between the grid and is incorporated herein in itsentirety and for all purposes. The coupling mechanism addressed in theLosasso paper is aimed at a fluid simulation. The idea is that someparts are represented fully by a grid and some parts are represented byparticles. In the present disclosure, any area of space using a gridwill also have particles. Additionally, the Losasso paper addressesdensity targeting for stacking of water particles. In contrast, thepresent disclosure uses density targeting for stacking of hair.

Given the input candidate velocities v*_(i) ^(n+1) and positions x_(i)^(n) from the step represented by Block 304 (FIG. 3), the velocities arerasterized to a grid. It should be appreciated that the candidatepositions in the present method include the effects of elasticity due tothe springs connecting the particles.

FIG. 4 is a detailed flowchart illustrating a technique 400 for thepreconditioning steps of FIG. 3 (i.e., steps represented by Blocks306-310) in accordance with an example embodiment. The rasterization ofthe candidate velocities includes rasterization of candidate timet^(n+1) segments (Block 402). The curve segments are rasterized at theircandidate locations instead of at their source locations. The curvesegments are used instead of rasterizing particles as other FLIPapproaches to cover the volume of hair in the case where each segment ofthe hair curve is sparsely sampled. Consider a segment with particles(i,j)ε S at its candidate positions (i.e. (x′_(i),x′_(j))=(x_(i)^(n)+Δtv*_(i) ^(n+1),x_(j) ^(n)+Δtv*_(j) ^(n+1))). Given a point x inspace which has distance d_(ij)(x) to the segment, define a weightw _(ij)(x)=max(0,r−d _(ij)(x)),where r is a user-defined radius of influence for each segment (Block404). In simulations, r=3Δx/2 was used, where Δx is the grid size,however, r may be defined to be other suitable values. Generally, theradius should be greater than the size of a grid cell so that it can beseen on the grid, but it should not be much greater than the size of agrid cell.

Once the weight is defined, the rasterized velocity at any point is:

${{v(x)} = \frac{\sum\limits_{{({i,j})} \in S}^{\;}\;{{w_{ij}(x)}\left\lbrack {{\left( {1 - {\alpha_{ij}(x)}} \right)v_{i}} + {{\alpha_{ij}(x)}v_{j}}} \right\rbrack}}{\sum\limits_{{({i,j})} \in S}^{\;}\;{w_{ij}(x)}}},$where α_(ij)(x) is the interpolation fraction of the closest point onthe segment. Velocities, weights and cell centers are then computed(Block 406). The velocities and weights are computed on the cell facesfor marker and cell (MAC) velocities and the cell centers are computedfor density control and separation condition computation. Velocities arecomputed on a MAC grid. That is, each cell face has a velocity in thedirection perpendicular to the plane of the face of the grid cell.

Once the velocities and weights are rasterized, a Poisson system ∇²p=∇·v*_(grid) ^(n+1) is set up (Block 408) to project the grid velocitiesto be divergence free, as represented in Block 308 of FIG. 3. Within thePoisson system, any cell with a weight lower than a threshold is set asa Dirichlet p=0 condition (Block 410). Generally, the threshold may be avalue less than 1. The threshold may be determined empirically toachieve desired results. Additionally, any face that is inside akinematic collision body is set to a zero Neumann boundary and thevelocity on that face is set to the object velocity (Block 412).

A divergence source term is set to a target density (Block 414). Inparticular, the rasterized cell weights are used to define a densitywhich can be targeted to a user defined density using a divergencesource term in the Poisson equation. In near collision objects this canlose effectiveness because kinematic velocity constraints interfere withdivergence. The fixed velocities may be modified on Neumann faces if theface's weight is behind the density target. To do so, the constrainedvelocity is added in the collision body's normal direction. This isanalogous to a penalty repulsion in Lagrangian dynamics, but handling itin the Poisson equation means it will be made consistent globally.

The results of density control can be seen in FIG. 5. In FIG. 5, a highdensity low volume example 500 is shown on the left-hand side, a highvolume low density example 502 is shown on the right-hand side, and amoderate density and volume example 506 is shown in the middle. Hence,using the density control a desired density and volume may be achieved.

Returning again to FIG. 4, after setting the divergence source term to atarget density, the Poisson system is solved with a preconditionedconjugate gradient and computing the divergence free velocity fieldv_(grid) ^({hacek over ( )}n+1{hacek over ( )})=v*_(grid) ^(n+1)−∇p(Block 416). It should be appreciated that any suitable approach tosolve Poisson systems may be used. In this example, the preconditionedconjugate gradient is used with an incomplete Cholesky preconditioner.Other embodiments may use Multigrid, symmetric successive overrelaxation (SSOR), or the like.

Optionally, in some embodiments, additional viscosity may also be addedto create additional friction (Block 418). Viscosity may be added bysolving a viscosity term in the Naview-Stokes equations. This can besolved explicitly by adding viscosity after rasterization but beforemaking the velocity field divergence free. It also can be done fullyimplicitly or mixed explicit/implicit as in Rasmussen, N., D. Enright,D. Nguyen, S. Marino, N Sumner, W. Geiger, S. Hoon, and R. Fedkiw,“Directable Photorealistic Liquids,” EUROGRAPHICS/ACM SIGGRAPH SYMPOSIUMON COMPUTER ANIMATION (2004), which is incorporated by reference hereinin its entirety and for all purposes. Additionally, in some embodiments,the viscosity may be variable. Accordingly, the viscosity of the hairmay be adjusted to a desired level to create a desired effect on themovement of the hair in the simulation. In the case of explicit/implicitvariable viscosity, this might involve two or more Poisson solves: onefor viscosity and one for divergence free solves. That is, the methodwould proceed thusly, solve the divergence free field, add explicitviscosity, solve implicit viscosity velocities and make divergence free.

After the Poisson system has been solved to compute velocities andaccount for collisions, FLIP is used to apply the velocity back to thei^(th) particle (Block 420) using the formulav _(i) ^(n+1) =ξ[v* _(i) ^(n+1)+(I(x _(i) ^(n) ,v _(grid) ^(n+1) −v*_(grid) ^(n+1)))]+(1−ξ)I(x _(i) ^(n) ,v _(grid) ^(n+1)),where I(x, v) is linear interpolation at location x of a vector field vand ξ controls the amount of FLIP. In regard to controlling the amountof FLIP, if x_(i) was set to 0, purely interpolated grid velocitieswould be used, giving a very damped look because velocities would tendto be averaged out by the interpolation kernel. If x_(i) were set to 1,a pure velocity impulse would be added, which would reduce diffusion,but possibly create too unstable of a result. In simulations, a value ofξ=0.95 was typically used, however, other values, such as 0.90, or avalue equal to or greater than 0.85, may be selected or otherwiseempirically determined to achieve a desired result.Hair Separation in the Volume

With volume/continuum approaches to hair, nearby hairs are forced tobehave similarly. This is desired when hair is under compression becauseit forces the velocity to be zero at the center, preventinginterpenetration; however, but when two regions of hairs have disparatevelocity fields, artificial coupling can create undesired sticking. Thisalso appears in fluid techniques when solid objects are coupled to thefluid. FIGS. 6A-6B illustrate an example of undesired sticking. In FIG.6A, two groups of hair 600 are moving apart (e.g. have divergentvelocity fields) as indicated by arrows 602, but some of the hairs 604from each group are coupled with the other grouping of hair. FIG. 6B isa zoomed view of the undesired sticking.

To prevent unwanted sticking, a hair separation condition may becomputed during the rasterization process. Consider a face of the gridhaving the two incident cell velocities v₁ and v₂. If v₁·n−v₂·n<γ, wheren is the vector pointing from cell 1 to cell 2, then a face isconsidered separating. This means that the domain of the grid should bedecoupled at this face, and cell 1 should not see the pressures on cell2 and vice versa. The row of the matrix of each cell is modified to seethe other cell as a ghost Dirichlet p=0 cell. This is accomplishedsimply by zeroing a_(ij) and a_(ji) in the matrix (preserving symmetry).This change means the face velocity cannot be projected because thegradient stencil 1/Δx(p₂−p₁) is no longer defined. Thus, interpolationof velocities to particles in cells 1 or 2 for FLIP is not defined sothese particles are not changed during the FLIP update. Even so, theircollisions are resolved by Lagrangian self-collisions.

FIGS. 7A-7B illustrate the results of the hair separation using theforegoing approach. In FIG. 7A two groups of hair 700 are illustratedhaving divergent velocity fields illustrated by the arrows 702. As canbe seen, the groups of hair 700 have no “stray” hair that is stickingwith the other group of hair.

Lagrangian Collisions

Once the velocities are interpolated back to particles (Block 310, FIG.3), a velocity field results that roughly considers self-collision andglobal collisions. Generally, fine details are missed because it hasbeen computed at the coarser resolution of the grid. If only a fewhundred guides were present, repulsions might be a good option forremoving the remaining collisions, but at the densities of the presentexamples (e.g., thousands of hairs), they become impractical becauserepulsions are proximity based, so as density increases and thicknessdecreases the repulsions look smaller compared to the velocities. Thus,a self-collisions solver is implemented to handle fine collisions.

Geometric collisions have been studied extensively for cloth simulationbecause they help prevent visual artifacts. A three stage process may beimplemented to help ensure no collisions are missed in applications forhair simulation. FIG. 8 is a flowchart illustrating the three stageprocess 800. First, contact is preconditioned using penalty-basedrepulsions that are small enough to prevent visual artifacts (Block802). Second, self-collisions are applied to stop as muchinterpenetration as possible (Block 804). In this context,interpenetration refers to hairs in a collision penetrating through thehair edges rather than colliding with at the edges. Third, rigid groups(impact zones) are used as a final safety net, post conditioning thecollisions (Block 806).

In other embodiments, one or more of the steps may be replaced and orimproved. For example, in one embodiment, the second step (Block 804)may be replaced with a globally coupled collision scheme, as set forthin Sifikis, E., S. Marino and J. Teran, “Globally Coupled Impulse-basedCollision Handling Cloth Simulation,” ACM SIGGRAPH/EUROGRAPHICSSYMPOSIUM ON COMPUTER ANIMATION (2008), which is incorporated herein inits entirety by reference for all purposes. The rigid impact zones maybe improved as set forth in Harmon, D., E. Vouga, R. Tamstorf and E.Grinspun, “Robust Treatment of Simultaneous Collisions,” ACM Trans.Graph., 27:3, 1-4 (2008), which is incorporated herein by reference inits entirety for all purposes. Additionally, the first step (Block 802)may be replaced as in Selle, A., J. Su, G. Irving, and R. Fedkiw,“Robust High-Resolution Cloth Using Parallelism, History-BasedCollisions and Accurate Friction,” R. IEEE TRANSACTIONS ON VISUALIZATIONAND GRAPHICS (TVCG), 15(2) 339-350, which is incorporated herein byreference in its entirety for all purposes.

For cloth, improving collisions through better post-conditioning is auseful technique, because failures in repulsions and self-collisionstypically do not result in significant visual artifacts. In hair,however, a deluge of repulsions and collisions applied using relativelyunstable edge/edge interactions result in configurations that would bedifficult to correct with a better rigid group technique. In someembodiments, it may be helpful to turn off collisions in contact casesto prevent these pitfalls.

The placement of volume handling before self-collisions not only allowsself-collisions the ability to create a final collision freeconfiguration, but preconditions the collision step, hence replacing arepulsion step. This allows prevention of poor configurations beforethey create visual artifacts in the self-collision and rigid group stepswhere the lack of stabilizing point/face interactions in hair makecollisions potentially more damaging. In many ways, the volume handlingis a better pre-conditioner than proximity-based repulsions because thepresent volume formulation considers velocities as well as positions.

System and Results

The present techniques for hair simulation may be executed by a computergraphics system. A simplified computer graphic system 900 is illustratedin FIG. 9. Generally, the computer graphics system 900 includes at leastone central processor 902 and one or more graphics processor 904. Insome embodiments, the at least one central processor 902 and the one ormore graphics processors 904 include at least one multicore processor,such as a dual core or quad core processor, for example. In someembodiments, a plurality of processors may be configured to operate inparallel to perform the hair modeling. Additionally, in someembodiments, the central processor 902 and the graphic processor 904 maybe part of the same group of processing cores.

The computer graphics system 900 includes a graphics memory 906 coupleddirectly to the graphics processor 904. The graphics memory 906functions as execution memory and may have a relatively large memorycapacity, as graphics applications are typically memory intensive.Execution memory may include various forms of random access memory(RAM), such as dynamic (RAM), static (RAM), and the like. In addition tothe dedicated graphics memory 906, memory/storage 908 is coupled to thecentral processor 902. In some embodiments, external storage may beprovided and communicatively coupled to the computer graphics system.Large amounts of information and data accessible by the processor 902may be stored on the storage device. The storage device may be a harddisk drive, a solid-state drive, or the like.

Additionally, one or more types of media players/recorders 910 arecoupled to the computer graphics system 900, such as DVD drives, Blu-rayDisc™ drives, and so forth. In some embodiments, the one or more mediaplayers may be integrated within the system 900. The modeled hair may bestored on one or more types of media using the media player/recorders910 for playback in other devices and in other environments.

User input may be provided to the system 900 via user input devices 912.The user input devices 912 may include a keyboard, a mouse, a trackball, a stylus, a camera, and so forth. The user input devices 912 allowa user to control the system 900 and provide input to the system tomanipulate the data (e.g., the density of the hair) to achieve a desiredresult.

Further, the computer graphics system 900 includes a display 914, suchas a plasma, LCD, CRT, etc., display to graphically display the modeledhair and allow for interaction with a user. As such, the computergraphics system is suited to perform the computation related to themodeling of hair, as well as graphically display the results of themodeled hair, i.e., render the modeled hair on a display.

The present hair simulation technique has been demonstrated with a rangeof examples in computer graphics system. The technique may beimplemented with a standard Lagrangian hair simulator and Eulerian fluidsolver and rendered using rendering software such as Pixar's Renderman®software and standard hair shading models. It would be feasible to applythe recent subsurface scattering and shadowing acceleration techniques,some of which might benefit from the presently presented rasterizedvolume. While no additional strands are generated at render time,traditional interpolation or clumping techniques may be utilized if morestrands are desired for rendering detail.

FIG. 10 illustrates results of complex contact and collision using abraid pattern consisting of 1500 hairs with approximately 100 particleseach. Moving left-to-right, three hair sections 1002 begin in a looseconfiguration with the top particle of each hair fixed. As gravity pullsthe hairs downward, a braid pattern emerges due to theEulerian/Lagrangian collisions.

FIGS. 11A-11D shows the present technique applied to an animatedcharacter walking in three frames (1102, 1104, and 1106) with 10,000simulated hairs. In this example, each frame may represent a time stepfor which the method of FIG. 3 is applied. The right most frame 1108 isa zoomed view to show the detail achieved with the hair simulation.

FIGS. 12A-12B illustrate real hair and hair simulated using the presenttechnique, respectively. In each, a group of hair is shown as beinglifted. As can be seen, the real hair example in FIG. 12A shows a webbedappearance resulting from complex collisions and contact. In thesimulated hair example in FIG. 12B, a similar effect is achieved usingthe present technique of the hybrid Euler and Lagrangian collisiontechniques. Thus, the present method compares favorably to real hairbehavior.

FIGS. 13A-13C compare the present method to Lagrangian and Euleriancollisions alone. FIG. 13A illustrates the present method 1302, FIG. 13Billustrates the pure Lagrangian method 1304, and FIG. 13C illustratesthe pure Eulerian method 1306.

For each method, a bundle of 1200 hairs is draped across aperpendicularly hanging bundle of 1200 more hairs (240,000 particles),as shown in the top frames 1300. Whereas purely Lagrangian collisionscreate highly active collision impulses (FIG. 13B, Frame 1308) due toinadequate hair coupling, purely Eulerian collisions are overly dampedand fail to resolve the collisions (FIG. 13C, Frame 1310). The resultsof the present method show a moderate amount of coupling from the volumetogether with fine details obtained with Lagrangian collisions (FIG.13A, Frame 1312) to provide a more natural appearance when compared tothe other methods.

A comparison of runtimes for the three techniques shows the purelyEulerian technique has the lowest average runtime per frame (5.6minutes). Although the present method computes both volumetric andLagrangian collisions, it is still significantly faster (8 minutes) perframe than Lagrangian collisions alone (13.6 minutes), showing theeffectiveness of the Eulerian divergence-free solve as a collisionpreconditioner. A further breakdown of timing is shown in Table 1. Notethat the total time includes time spent on time integration.

TABLE 1 Total Geometric Volume Time Technique Collisions (m) Substep (m)(m)/Frame Geometric 9.34 N/A 13.64 Collisions only Volume Only N/A 3.555.67 Hybrid Method 1.14 3.65 7.97

The simulation time was about 15 minutes (26.9% Lagrangian collisions,33.9% volumetric, 39.2% mass/spring time integration) per frame for thecharacter on a single machine which is an improvement over the 16-wayparallel runtimes of prior techniques. The time-step was determined bythe mass spring Courant condition, though in many examples thevolumetric step provided some extra stability, allowing relaxation ofthe time-step restriction.

While the present technique makes high fidelity interactions tractable,there may be some limitations. In particular, the resolution of thevolume creates some numerical viscosity and, in particular, angularvelocity dissipation. This can be controlled by reducing the use of thevolume substep (at the expense of less efficiency) or by increasing theresolution of the grid. Additionally, if the grid is too coarse, hairthat becomes severely tangled may not be able to separate.

Several improvements to the technique may be possible. For example, moreconservative methods of coupling the volumetric data back to theparticle data may be implemented. For example, as the volumetric datamay be integrated only to colliding vertices. Accordingly, lessvolumetric data is interpolated back into the particles from the volumemethods. For non-colliding vertices, the original particle data may beused when computing the Lagrangian self-collisions and body collisions.

Also, improved performance may be achieved using several methods. Forexample, an adaptive octree grid would allow different volumeresolutions at different parts of the hair volume. In a large volume ofhair, hair that is not visible may not require a highly detailedvelocity field. Creating a level set by applying a fast marching methodto the previous time steps density volume could derive a refinementcriterion. That is, one could create a level set from a rasterizeddensity (weight field) where the density measures where material is. Alevel set measures a distance to a surface, so the surface of the hairvolume is defined. Then, the fast marching method can be used to extenddistances to a grid of values as described in Sethian, J. A., PROC. NAT.ACAD. SCI., 93: 4, 1591-1595 (1996), which is incorporated by referenceherein in its entirety and for all purposes.

In addition, there are many parts of the present algorithm that areparallelizable (i.e., that may be processed in parallel). The backwardEuler solve of each strand of hair is decoupled so each hair could besolved in parallel. Rasterization and solving the Poisson equation iseasy to parallelize as well, so it should map well to multicorearchitectures and graphics hardware. Further, this technique may beapplied to cloth as a replacement to the Bridson repulsions to betterprecondition the cloth collisions.

The present technique hybridizes Lagrangian and Eulerian hair simulationtechniques. Implementing FLIP and SPH fluid technology, the presentmodel can be useful as a way of controlling the integration of volumebased forces. In addition, the volume computation can ease collisiondifficulties with hair by acting as an improved preconditioner.Moreover, the factorization of hair interaction into a coarse globallycoupled phenomena and a highly detailed Lagrangian view is an effectivestrategy for balancing efficiency and a high amount of detail.

Although the present disclosure has been described with respect toparticular systems and methods, it should be recognized upon readingthis disclosure that certain changes or modifications to the embodimentsand/or their operations, as described herein, may be made withoutdeparting from the spirit or scope of the invention. Accordingly, theproper scope of the disclosure is defined by the appended claims and thevarious embodiments, operations, components, methods and configurationsdisclosed herein are exemplary rather than limiting in scope.

The invention claimed is:
 1. A hybrid hair simulation method using acomputer graphics system, the method comprising: generating a pluralityof modeled hair strands using a processor of the computer graphicssystem, each hair strand comprising: a plurality of particles; and aplurality of spring members coupled in between the plurality ofparticles; determining a first position and a first velocity for eachparticle in the plurality of modeled hair strands using the processor;coarsely modeling movement of the plurality of modeled hair strands asan incompressible fluid with a continuum fluid solver using theprocessor; and computing self-collisions of the plurality of modeledhair strands with a discrete collision model using the processor.
 2. Themethod of claim 1 wherein determining the first velocity or eachparticle comprises computing backward Euler velocities.
 3. The method ofclaim 2 wherein coarsely modeling movement of the plurality of modeledhair strands with the continuum fluid solver comprises: rasterizing theparticle velocities defined with backward Euler to a grid; and computingdivergence free velocities.
 4. The method of claim 3 wherein rasterizingthe backward Euler velocities to a grid comprises: computing velocitieson a face of a grid cell; computing a weight of the center of the gridcell; and computing a weight on a face of the grid cell.
 5. The methodof claim 4 wherein computing the divergence free velocities comprises:generating a Poisson system; setting a grid cell having a weight lessthan a threshold weight to Dirichlet p=0; setting a grid cell inside acollision body to a zero Neumann boundary; setting the velocity on theface of the grid cell inside the collision body to object velocity;setting a divergence source term to a target density; solving thePoisson system with a preconditioned conjugate gradient; and computing adivergence free velocity field.
 6. The method of claim 5 furthercomprising using the rasterized cell weights to define a density, thedensity being targeted to a user defined density.
 7. The method of claim4 further comprising computing a hair separation during therasterization process.
 8. The method of claim 5 further comprisingadding viscosity to the create additional friction.
 9. The method ofclaim 3 further comprising interpolating the divergence free velocitiesto particles.
 10. The method of claim 9 wherein interpolating thedivergence free velocities to particles comprises implementing a fluidimplicit particle (FLIP) technique fluid using the formula:v _(i) ^(n+1) =ξ[v* _(i) ^(n+1)+(I(x _(i) ^(n) ,v _(grid) ^(n+1) −v*_(grid) ^(n+1)))]+(1−ξ)I(x _(i) ^(n) ,v _(grid) ^(n+1)).
 11. The methodof claim 1 wherein computing self-collisions using a Lagrangiancollision model comprises performing collision computations comprising:preconditioning contact using penalty-based repulsions; applyself-collisions to prevent interpenetration; and post-condition theself-collisions using rigid groups.
 12. The method of claim 1, whereincomputing self-collisions of the plurality of modeled hair strandsdetermines one or more direct interactions between two or more hairs inthe plurality of hairs.
 13. The method of claim 1, wherein coarselymodeling movement of the plurality of hair strands preconditions theself-collisions of the plurality of modeled hair strands.
 14. The methodof claim 1 further comprising adding torsion to the plurality of modeledhair strands.
 15. A Eulerian and Lagrangian hybrid method of artificialhair simulation using a computer graphics system comprising: determiningan initial position and a velocity for each of a plurality of hairstrands; computing a backward Euler solve for each of the plurality ofhair strands; rasterizing the velocity of each of the plurality of hairstrands to a three-dimensional grid; using a volume technique to modifythe velocity into a corrected divergence free velocity, wherein theplurality of hair strands is modeled as an incompressible fluid;interpolating the modified velocity out of the three-dimensional grid;further modifying the modified velocity to satisfy body andself-collisions; and computing a final position of each of the pluralityof hair strands.
 16. The hybrid method of claim 15 wherein interpolatingthe modified velocity out of the three-dimensional grid comprises usinga fluid implicit particle technique.
 17. The hybrid method of claim 15wherein the plurality of hair strands are modeled as a plurality ofparticles coupled in sequence with springs, wherein every other springis a bending spring.
 18. The hybrid method of claim 15 whereininterpolating the modified velocity out of the three-dimensional gridcomprises interpolating the modified velocity only for collidingvertices in a the three-dimensional grid.
 19. The hybrid method of claim15 wherein in a large volume of modeled hair, hair strands that are notvisible are nut processed to further modify the modified velocity tosatisfy body and self-collisions.
 20. The hybrid method of claim 15wherein computing the backward Euler solve for each of the plurality ofhair strands is performed in parallel.
 21. The hybrid method of claim 15wherein rasterizing the velocity of each of the plurality of hairstrands to a three-dimensional grid is performed in parallel.
 22. Acomputer graphics system for simulating hair using a Eulerian/Lagrangianhybrid method, the computer graphics system comprising: at least oneprocessor; and at least one computer readable medium communicativelycoupled to the at least one processor, the at least one computerreadable medium including code executable by the at least one processorto: determine a first collision-free location and a first velocity foreach particle of one or more computer generated stands of hair;rasterize the first velocity to a grid; compute a second velocity of thecomputer graphic strands of hair for the second velocity being divergentfree; apply a fluid implicit particle (FLIP) solver to the secondvelocity to interpolate the second velocity to the particles, whereinthe one more strands of hair are modeled in the FLIP solver anincompressible fluid; compute body and self-collisions of the one ormore strands of hair; and determine a final position of the one or morecomputer graphic strands of hair.
 23. The computer graphics system ofclaim 22 wherein the code is configured to use the final position as anew first position and iteratively determine a new final position. 24.The computer graphics system of claim 23 further comprising a displayconfigured to sequentially output the iterative final positions to thedisplay as a graphical representation of the one or more strands ofhair.